home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98a.txt
/
000110_icon-group-sender _Mon Mar 9 15:45:01 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id PAA08142
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 9 Mar 1998 15:44:57 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA12327; Mon, 9 Mar 1998 15:44:57 -0700
Date: Mon, 9 Mar 1998 17:11:55 -0600
Message-Id: <199803092311.RAA19535@segfault.cs.utsa.edu>
From: Clinton Jeffery <jeffery@segfault.cs.utsa.edu>
To: icon-group@optima.CS.Arizona.EDU
In-Reply-To: <35043AF2.20D5@gte.net> (message from Mark Evans on Mon, 09 Mar
1998 12:54:42 -0600)
Subject: Re: Stripping don't-cares
Reply-To: jeffery@cs.utsa.edu
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 895
> Mark Evans asked:
> Briefly, what is the optimum method of stripping don't-care characters
> from each line of input? ...map() can replace characters, but I want
> them to just go away.
Mark,
There is a trim() function that trims dont_care's off the end of a string,
but to trim stuff in the middle of the string you need to actually walk
through the string one way or another.
The sleaziest way I know would be something like:
while line[upto(dont_care,line)] := ""
a sneaky refinement is
x := 1
while line[x := upto(dont_care, line, x)] := ""
If you have to do this for large files and are concerned about efficiency,
there may be more efficient ways to do it. I bet icon-group can come up
with 8 different solutions with varying performance. I didn't check these
solutions for off-by-one errors; I guess you can do that for me. :-)
Clint Jeffery, jeffery@cs.utsa.edu